<%@ page import="com.itheima.jspdemo.pojo.Brand" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: ThinkPad
  Date: 2022/11/21
  Time: 11:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="新增"><br>
<hr>
<table border="1" cellspacing="0" width="800">
    <tr>
        <th>序号</th>
        <th>品牌名称</th>
        <th>企业名称</th>
        <th>排序</th>
        <th>品牌介绍</th>
        <th>状态</th>
        <th>操作</th>

    </tr>
    <%
        // 思想还是遍历TR
        // 品牌列表是从哪里获取，从request对象中提取数据,根据key取值
        List<Brand> listBrand = (List<Brand>) request.getAttribute("brandList");
        for (Brand brand:listBrand){
            // ${brand.id} ${}读数据是从4给对象依次查找
            // 把对象放再hashmap里面，或${}只能从如图4给对象中获取
            request.setAttribute("b1",brand);
    %>

        <tr align="center">
            <td>${b1.id}</td>
            <td>${b1.brandName}</td>
            <td>${b1.companyName}</td>
            <td>${b1.ordered}</td>
            <td>${b1.description}</td>
            <td>${b1.status}</td>
            <td><a href="#">修改</a> <a href="#">删除</a></td>
        </tr>
    <%
        }
    %>

</table>

</body>
</html>
